From: Ewan Mellor Date: Sun, 25 Mar 2007 23:09:00 +0000 (+0100) Subject: Fix the VM.is_a_template flag for domain 0. X-Git-Tag: archive/raspbian/4.8.0-1+rpi1~1^2~15277^2~8 X-Git-Url: https://dgit.raspbian.org/%22http://www.example.com/cgi/%22/%22http:/www.example.com/cgi/%22?a=commitdiff_plain;h=d4eac439d5e67640f63dc5c03d51e23201c73ed3;p=xen.git Fix the VM.is_a_template flag for domain 0. Signed-off-by: Ewan Mellor --- diff --git a/tools/python/xen/xend/XendAPI.py b/tools/python/xen/xend/XendAPI.py index 01c2f0a6ce..63da4a6138 100644 --- a/tools/python/xen/xend/XendAPI.py +++ b/tools/python/xen/xend/XendAPI.py @@ -1546,7 +1546,7 @@ class XendAPI(object): 'name_label': xeninfo.getName(), 'name_description': xeninfo.getName(), 'user_version': 1, - 'is_a_template': xeninfo.info.get('is_a_template'), + 'is_a_template': xeninfo.info['is_a_template'], 'auto_power_on': False, 'resident_on': XendNode.instance().uuid, 'memory_static_min': xeninfo.get_memory_static_min(), @@ -1576,7 +1576,7 @@ class XendAPI(object): 'tools_version': xeninfo.get_tools_version(), 'other_config': xeninfo.info.get('other_config', {}), 'domid': domid is None and -1 or domid, - 'is_control_domain': xeninfo == xendom.privilegedDomain(), + 'is_control_domain': xeninfo.info['is_control_domain'], 'metrics': xeninfo.get_metrics() } return xen_api_success(record) diff --git a/tools/python/xen/xend/XendConfig.py b/tools/python/xen/xend/XendConfig.py index 9600433d07..a93c064551 100644 --- a/tools/python/xen/xend/XendConfig.py +++ b/tools/python/xen/xend/XendConfig.py @@ -298,6 +298,8 @@ class XendConfig(dict): 'actions_after_reboot': 'restart', 'actions_after_crash': 'restart', 'actions_after_suspend': '', + 'is_template': False, + 'is_control_domain': False, 'features': '', 'PV_bootloader': '', 'PV_kernel': '', diff --git a/tools/python/xen/xend/XendDomainInfo.py b/tools/python/xen/xend/XendDomainInfo.py index 7c1d9614c4..356cf4b947 100644 --- a/tools/python/xen/xend/XendDomainInfo.py +++ b/tools/python/xen/xend/XendDomainInfo.py @@ -127,6 +127,8 @@ def recreate(info, priv): assert not info['dying'] xeninfo = XendConfig.XendConfig(dominfo = info) + xeninfo['is_control_domain'] = priv + xeninfo['is_a_template'] = False domid = xeninfo['domid'] uuid1 = uuid.fromString(xeninfo['uuid']) needs_reinitialising = False